<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="vlms.bean.Movie"%>
<%@ page import="vlms.bean.Person"%>
<%@ page import="vlms.bean.PremiumCustomer"%>
<% 


Person[] personList=(Person[])request.getAttribute("PersonList");

PremiumCustomer[] premiumList=(PremiumCustomer[]) request.getAttribute("PremiumCustomer");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>DisplayAllPremiumCustomer</title>
</head>
<body>
<table width="100%">
<%@ include file="/header.jsp" %>

<tr valign="top" height="50px">
<td align="center">
<%@ include file="/headerLinks.jsp" %>
</td>
</tr>

<% if(request.getAttribute("message") != null) { %>
<tr><td align="center" style="color:red"><%= request.getAttribute("message") %></td></tr>
<% } %>
<tr valign="top"><td align="center" height="300px">
<center>

<div class="inputColumn" id="movieList"
			style="text-align: center; border: thin; margin: auto;">
			<table border="1">
				
				<%
				if(personList!=null)
				{
						
						
				%>
				<tr>
					
					<td align="right">
					<label name="emailId" style="size: 30;">Email Id</label>
					</td>
					<td align="right">
					<label name="firstName" style="size: 30;">First Name</label>
					</td>
					<td align="right">
					<label name="lastName" style="size: 30;">Last Name</label>
					</td>
					<td align="right">
					<label name="city" style="size: 30;">City</label>
					</td>
					<td align="right">
					<label name="state" style="size: 30;">State</label>
					</td>
					<td align="right">
					<label name="memType" style="size: 30;">Member Type</label>
					</td>
					<td align="right">
					<label name="membershipNo" style="size: 30;">Membership Number</label>
					</td>
					<td align="right">
					<label name="outstandingMovies" style="size: 30;">Outstanding Movies</label>
					</td>
				</tr>
				
				<%
				
				int indexPremium=0;
				for(int j=0;j<personList.length;j++)
				{
					String memberType="";
					if(personList[j].getMembertype().equals("PC"))
					{
						memberType="Premium Customer";
				%>
<tr>
					
					<td align="right">
					<label name="emailId" style="size: 30;"><%=personList[j].getEmailid() %></label>
					</td>
					<td align="right">
					<label name="firstName" style="size: 30;"><%=personList[j].getFirstname() %></label>
					</td>
					<td align="right">
					<label name="lastName" style="size: 30;"><%=personList[j].getLastname() %></label>
					</td>
					<td align="right">
					<label name="city" style="size: 30;"><%=personList[j].getCity() %></label>
					</td>
					<td align="right">
					<label name="state" style="size: 30;"><%=personList[j].getState() %></label>
					</td>
					<td align="right">
					
						<label name="memType" style="size: 30;"><%=memberType %></label>
						</td>
						<td align="right">
						<label name="membershipNo" style="size: 30;"><%=premiumList[indexPremium].getMembershipno() %></label>
						</td>
						<td align="right">
						<label name="outstandingMovies" style="size: 30;"><%=premiumList[indexPremium].getOutstandingmovies()%></label>
						</td>
					<%	
					indexPremium++;
					}
					
					%>
					
					
					
				</tr>
				
				<%
				
					}
				}
				%>
		</table>
			</div>

</center>
<%@ include file="/bottom.html" %>
</table>

</body>
</html>